﻿<UserControl x:Class="Wallace.IDE.SalesForce.UI.LogViewerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:localUI="clr-namespace:Wallace.IDE.Framework.UI"
             xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"   
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <StackPanel Grid.Row="0"
                    Orientation="Horizontal">
            <TextBlock Text="Traced Entity:"
                        FontWeight="Bold" 
                        Foreground="Black"
                        Margin="0,5,5,5"/>
            <TextBlock x:Name="textBlockEntity"
                        Foreground="Black"
                        Margin="0,5,5,5"/>
        </StackPanel>

        <DataGrid x:Name="dataGridLogs"
                  Grid.Row="1"
                  AutoGenerateColumns="False"
                  RowHeaderWidth="0"
                  HorizontalGridLinesBrush="Gray"
                  VerticalGridLinesBrush="Gray"
                  SelectionMode="Single"
                  SelectionUnit="FullRow"
                  AlternationCount="2"
                  AlternatingRowBackground="#F1F1F1"
                  Margin="0,0,0,5"
                  SelectionChanged="dataGridLogs_SelectionChanged">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Start" Binding="{Binding StartTime}" IsReadOnly="True" />
                <DataGridTextColumn Header="Duration (ms)" Binding="{Binding Duration}" IsReadOnly="True" />
                <DataGridTextColumn Header="Operation" Binding="{Binding Operation}" IsReadOnly="True" />
                <DataGridTextColumn Header="Status" Binding="{Binding Status}" IsReadOnly="True" />
            </DataGrid.Columns>
            <DataGrid.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
            </DataGrid.Resources>
        </DataGrid>

        <GridSplitter Grid.Row="1" 
                      Height="5"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Bottom"
                      Background="White" />

        <TabControl x:Name="tabControlContent"
                    Grid.Row="2"
                    TabStripPlacement="Bottom"
                    localUI:ChromeTab.ShowOverflowButton="False"
                    Style="{StaticResource ChromeTabControlStyle}">
            <TabItem x:Name="tabItemLogText"
                     Header="Text "
                     localUI:ChromeTab.ShowCloseButton="False">
                <avalonEdit:TextEditor x:Name="textEditor"
                                       FontFamily="Consolas"
                                       FontSize="10pt"
                                       HorizontalScrollBarVisibility="Auto"
                                       VerticalScrollBarVisibility="Visible"
                                       ShowLineNumbers="True" 
                                       IsReadOnly="True"
                                       UseLayoutRounding="True">
                    <avalonEdit:TextEditor.Options>
                        <avalonEdit:TextEditorOptions EnableHyperlinks="False" 
                                                      EnableEmailHyperlinks="False"/>
                    </avalonEdit:TextEditor.Options>
                </avalonEdit:TextEditor>
            </TabItem>
            <TabItem x:Name="tabItemLogData"
                     Header="Data "
                     localUI:ChromeTab.ShowCloseButton="False">
                <TreeView x:Name="treeViewData" />
            </TabItem>
        </TabControl>

    </Grid>
</UserControl>
